package com.example.runningdemo.designModel.template;

/**
 * @program: Running-Demo
 * @description: 抽象模板
 * @author: kangwei
 * @create: 2024-08-12 09:03
 **/
public abstract class RestaurantTemplate {

    // 看菜单
    public void menu() {
        System.out.println("菜单都一样");
    }

    // 点菜
    abstract void spotMenu();

    // 吃
    public void havingDinner() {
        System.out.println("吃饭");
    }

    // 支付
    abstract void payment();

    // 走
    public void run() {
        System.out.println("离开饭店");
    }

    public void process() {
        menu();
        spotMenu();
        havingDinner();
        payment();
        run();
    }
}
